#include<iostream>
#include<stdio.h>
#include<string.h>
#include<unistd.h>

using namespace std;

int main()
{
    char* msg0="hello printf\n";
    char* msg1="hello fprintf\n";
    char* msg2="hello fwrite\n";
    char* masg3="hello write\n";

    printf("%s",msg0);
    fprintf(stdout,"%s",msg1);
    fwrite(msg2,strlen(msg2),1,stdout);
    write(1,masg3,strlen(masg3));

    fork();
    return 0;
    // 编译后可分别./buff  ./buff > test.txt 查看结果
}